package com.example.neteasemusic.welcome


import androidx.viewbinding.ViewBinding
import com.bumptech.glide.Glide
import com.example.lib_data.base.activity.BaseActivity
import com.example.lib_data.bmob.AdvManager
import com.example.neteasemusic.databinding.ActivityWelcomeBinding

class WelcomeActivity : BaseActivity() {
    override fun getLayoutBinding(): ViewBinding? {
        return ActivityWelcomeBinding.inflate(layoutInflater,null,false)
    }

    override fun initUI() {
            //提前下载广告的url资源
            AdvManager.instance.loadAdvs{
                if (!it) return@loadAdvs
                //获取即将显示的图片的url
                val adv = AdvManager.instance.getAdv() ?: return@loadAdvs
                //提前下载url对应的图片
                Glide.with(this).load(adv.url).preload()
            }
    }
}